package com.sk.waste.app.models

import org.json.JSONObject
import java.io.Serializable

/**
 *  @time 2025/05/01  11:30
 *  @desc 行情报价
 */
class MarketModel : Serializable {
    var id: String = ""//
    var marketTypeCode: String = ""//
    var marketTypeName: String = ""//
    var productName: String = ""
    var lowPrice: String = ""
    var hightPrice: String = ""
    var differencePrice: String = ""
    var unit: String = ""//单位
    var status: String = ""
    var updateTime: String = ""

    fun getModelInfo(json: JSONObject) {
        id = json.getString("id")
        marketTypeCode = json.getString("marketTypeCode")
        marketTypeName = json.getString("marketTypeName")
        productName = json.getString("productName")
        lowPrice = json.getString("lowPrice")
        if (!json.isNull("highPrice")) {
            hightPrice = json.getString("highPrice")
        }
        differencePrice = json.getString("differencePrice")
        if (!json.isNull("unit")) {
            unit = json.getString("unit")
        }
        status = json.getString("status")
        updateTime = json.getString("updateTime")
    }

}